package com.movitech.mobile.cz.base.modules.config;

/**
 * Created by robie.cao on 2018/4/26.
 */
public enum ContactStatusEnum {

    CONTACTSTATUS1("尚未生效", 1),
    CONTACTSTATUS2("未结算", 2),
    CONTACTSTATUS3("已结算", 3),
    CONTACTSTATUS4("已结清", 4),
    CONTACTSTATUS5("已作废", 5);

    private String desc;
    private Integer code;

    private ContactStatusEnum(String desc, Integer code) {
        this.desc = desc;
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public static String getDesc(Integer code) {
        for (ContactStatusEnum c : ContactStatusEnum.values()) {
            if (c.getCode() == code) {
                return c.getDesc();
            }
        }
        return null;
    }

}
